package com.mg.admin.controller.admin;

import com.mg.admin.bean.admin.LogVO;
import com.mg.admin.bean.admin.Result;
import com.mg.admin.controller.BaseController;
import com.mg.admin.page.PageBean;
import com.mg.admin.page.PageParam;
import com.mg.admin.service.admin.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * 日志管理控制器
 */

@Controller
@RequestMapping(value = "/admin/log/")
public class LogController extends BaseController {

    @Autowired
    private LogService logService;

    @GetMapping(LIST)
    public void list() {

    }

    @ResponseBody
    @RequestMapping(value = PAGE)
    public Result<PageBean> queryForPage(LogVO logVO) {
        PageParam pageParam = new PageParam(logVO.getStart(),logVO.getLength());
        PageBean pageBean = logService.listForPage(logVO,pageParam);
        return new Result<>(pageBean);
    }


}
